package com.examples.intentfilters;

import android.app.Activity;
import android.content.Intent;
import android.net.Uri;
import android.os.Bundle;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.Button;

public class MainActivity extends Activity {
    /** Called when the activity is first created. */
    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.main);
        
        // Create an implicit Intent, will let the user choose what activity 
		// to start (if there are choices) 
        final Intent firstIntent = new Intent();
        firstIntent.setAction(Intent.ACTION_VIEW);
        firstIntent.setData(Uri.parse("http://www.google.se"));
        
        Button firstButton = (Button) findViewById(R.id.firstButton);
        firstButton.setOnClickListener(new OnClickListener() {
			
			public void onClick(View v) {
				startActivity(firstIntent);
			}
		});
    }
}